home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "How to disable multitasking keys, by Alesh Mustar"
- ClientHeight = 3105
- ClientLeft = 4200
- ClientTop = 4815
- ClientWidth = 6690
- Height = 3510
- Left = 4140
- LinkTopic = "Form1"
- ScaleHeight = 3105
- ScaleWidth = 6690
- Top = 4470
- Width = 6810
- Begin VB.CommandButton Command2
- Caption = "Enable Multitasking keys"
- Height = 1035
- Left = 3660
- TabIndex = 1
- Top = 1230
- Width = 2475
- End
- Begin VB.CommandButton Command1
- Caption = "Disable Multitasking keys"
- Height = 1005
- Left = 690
- TabIndex = 0
- Top = 1230
- Width = 2175
- End
- Begin VB.Label Label1
- Height = 255
- Left = 2580
- TabIndex = 2
- Top = 690
- Width = 1455
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Private Declare Function SystemParametersInfo Lib "user32" _
- Alias "SystemParametersInfoA" (ByVal uAction As Long, _
- ByVal uParam As Long, lpvParam As Any, _
- ByVal fuWinIni As Long) As Long
- Private Const SPI_SCREENSAVERRUNNING = 97
- Private Sub Command1_Click()
- 'lets enable the keys back
- Dim ret As Integer
- Dim pOld As Boolean
- ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)
- Label1.Caption = "Keys Disabled"
- End Sub
- Private Sub Command2_Click()
- 'lets call the API call, which is used in the screen saver also
- Dim ret As Integer
- Dim pOld As Boolean
- ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
- Label1.Caption = "Keys Enabled"
- End Sub
- Private Sub Form_Load()
- Label1.Caption = "Keys Enabled"
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- 're-enable Ctrl+Alt+Del and Alt+Tab before the program terminates
- Command2_Click
- End Sub
-